﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Palpite.aspx.vb" Inherits="BolaoF1_2.Palpite" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        Palpite<br />
        <br />
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataSourceID="HistoricoPalpite">
            <Columns>
                <asp:BoundField DataField="Dt" HeaderText="Dt (Brasilia)" SortExpression="Dt" />
                <asp:BoundField DataField="P1" HeaderText="P1" SortExpression="P1" />
                <asp:BoundField DataField="P2" HeaderText="P2" SortExpression="P2" />
                <asp:BoundField DataField="P3" HeaderText="P3" SortExpression="P3" />
                <asp:BoundField DataField="P4" HeaderText="P4" SortExpression="P4" />
                <asp:BoundField DataField="P5" HeaderText="P5" SortExpression="P5" />
                <asp:BoundField DataField="P6" HeaderText="P6" SortExpression="P6" />
                <asp:BoundField DataField="P7" HeaderText="P7" SortExpression="P7" />
                <asp:BoundField DataField="P8" HeaderText="P8" SortExpression="P8" />
                <asp:BoundField DataField="Pole" HeaderText="Pole" SortExpression="Pole" />
                <asp:BoundField DataField="Lap" HeaderText="Lap" SortExpression="Lap" />
                <asp:BoundField DataField="Team" HeaderText="Team" SortExpression="Team" />
            </Columns>
        </asp:GridView>
        <asp:AccessDataSource ID="HistoricoPalpite" runat="server" 
            DataFile="~/App_Data/lada.mdb" SelectCommand="SELECT     Palpite.Dt, P1.Nome AS P1, P2.Nome AS P2, P3.Nome AS P3, P4.Nome AS P4, P5.Nome AS P5, P6.Nome AS P6, P7.Nome AS P7, P8.Nome AS P8, 
                      Pole.Nome AS Pole, Lap.Nome AS Lap, Team.Nome AS Team
FROM         (((((((((((Palpite INNER JOIN
                      Piloto P1 ON Palpite.P1 = P1.IdPiloto) INNER JOIN
                      Piloto P2 ON Palpite.P2 = P2.IdPiloto) INNER JOIN
                      Piloto P3 ON Palpite.P3 = P3.IdPiloto) INNER JOIN
                      Piloto P4 ON Palpite.P4 = P4.IdPiloto) INNER JOIN
                      Piloto P5 ON Palpite.P5 = P5.IdPiloto) INNER JOIN
                      Piloto P6 ON Palpite.P6 = P6.IdPiloto) INNER JOIN
                      Piloto P7 ON Palpite.P7 = P7.IdPiloto) INNER JOIN
                      Piloto P8 ON Palpite.P8 = P8.IdPiloto) INNER JOIN
                      Piloto Pole ON Palpite.Pole = Pole.IdPiloto) INNER JOIN
                      Piloto Lap ON Palpite.Lap = Lap.IdPiloto) INNER JOIN
                      Equipe Team ON Palpite.Team = Team.IdEquipe)
WHERE     (Palpite.IdUsuario = ?) AND (Palpite.IdGP = ?)
ORDER BY Palpite.Dt">
            <SelectParameters>
                <asp:SessionParameter Name="?" SessionField="IdUsuario" />
                <asp:QueryStringParameter Name="?" QueryStringField="IdGP" />
            </SelectParameters>
        </asp:AccessDataSource>
        <br />
        P1:<asp:DropDownList ID="drdP1" runat="server" DataSourceID="Piloto" 
            DataTextField="Nome" DataValueField="IdPiloto">
        </asp:DropDownList>
        <asp:AccessDataSource ID="Piloto" runat="server" DataFile="~/App_Data/lada.mdb" 
            
            SelectCommand="SELECT CStr(PilotoEquipeTemporada.NumeroCarro) + ' - ' + Piloto.Nome + ' - ' + Equipe.Nome AS Nome, Piloto.IdPiloto FROM (((Piloto INNER JOIN PilotoEquipeTemporada ON Piloto.IdPiloto = PilotoEquipeTemporada.IdPiloto) INNER JOIN TemporadaCorrente ON PilotoEquipeTemporada.Temporada = TemporadaCorrente.Corrente) INNER JOIN Equipe ON PilotoEquipeTemporada.IdEquipe = Equipe.IdEquipe) WHERE (PilotoEquipeTemporada.Habilitado = true) ORDER BY PilotoEquipeTemporada.NumeroCarro">
        </asp:AccessDataSource>
        <br />
        P2:<asp:DropDownList ID="drdP2" runat="server" DataSourceID="Piloto" 
            DataTextField="Nome" DataValueField="IdPiloto">
        </asp:DropDownList>
        <br />
        P3:<asp:DropDownList ID="drdP3" runat="server" DataSourceID="Piloto" 
            DataTextField="Nome" DataValueField="IdPiloto">
        </asp:DropDownList>
        <br />
        P4:<asp:DropDownList ID="drdP4" runat="server" DataSourceID="Piloto" 
            DataTextField="Nome" DataValueField="IdPiloto">
        </asp:DropDownList>
        <br />
        P5:<asp:DropDownList ID="drdP5" runat="server" DataSourceID="Piloto" 
            DataTextField="Nome" DataValueField="IdPiloto">
        </asp:DropDownList>
        <br />
        P6:<asp:DropDownList ID="drdP6" runat="server" DataSourceID="Piloto" 
            DataTextField="Nome" DataValueField="IdPiloto">
        </asp:DropDownList>
        <br />
        P7:<asp:DropDownList ID="drdP7" runat="server" DataSourceID="Piloto" 
            DataTextField="Nome" DataValueField="IdPiloto">
        </asp:DropDownList>
        <br />
        P8:<asp:DropDownList ID="drdP8" runat="server" DataSourceID="Piloto" 
            DataTextField="Nome" DataValueField="IdPiloto">
        </asp:DropDownList>
        <br />
        <br />
        Pole:<asp:DropDownList ID="drdPole" runat="server" DataSourceID="Piloto" 
            DataTextField="Nome" DataValueField="IdPiloto">
        </asp:DropDownList>
        <br />
        Lap:<asp:DropDownList ID="drdLap" runat="server" DataSourceID="Piloto" 
            DataTextField="Nome" DataValueField="IdPiloto">
        </asp:DropDownList>
        <br />
        Team:<asp:DropDownList ID="drdTeam" runat="server" DataSourceID="Equipe" 
            DataTextField="Nome" DataValueField="IdEquipe">
        </asp:DropDownList>
        <asp:AccessDataSource ID="Equipe" runat="server" DataFile="~/App_Data/lada.mdb" 
            SelectCommand="SELECT DISTINCT Equipe.Nome, Equipe.IdEquipe FROM ((Equipe INNER JOIN PilotoEquipeTemporada ON Equipe.IdEquipe = PilotoEquipeTemporada.IdEquipe) INNER JOIN TemporadaCorrente ON PilotoEquipeTemporada.Temporada = TemporadaCorrente.Corrente) WHERE (PilotoEquipeTemporada.Habilitado = true) ORDER BY Equipe.Nome">
        </asp:AccessDataSource>
        <br />
        <asp:Button ID="btnGravar" runat="server" Text="Gravar" Height="26px" />
    
    </div>
    </form>
</body>
</html>
